CAPTOR FUND MANAGEMENT

An introduction to the openseries Python package

First we set it all up

In [1]:
from openseries.series import OpenTimeSeries
from openseries.frame import OpenFrame

from plotly.offline import init_notebook_mode
from plotly.offline import iplot
In [2]:
init_notebook_mode()

Here we fetch NAV (price per unit) for some of the Captor mutual funds

In [3]:
basket = OpenFrame(
    [
        OpenTimeSeries.from_open_nav(isin="SE0009807308"),
        OpenTimeSeries.from_open_nav(isin="SE0011337195"),
        OpenTimeSeries.from_open_nav(isin="SE0011670843"),
    ], weights=[
        1.0 / 3, 
        1.0 / 3, 
        1.0 / 3])

basket = basket.trunc_frame().to_cumret()

We then make a portfolio of the funds based on the provided weights

In [4]:
portfolio = OpenTimeSeries.from_df(basket.make_portfolio("Portfolio"))
basket = basket.add_timeseries(portfolio)

And create a Plotly plot of all the data

In [5]:
figure, _ = basket.plot_series(tick_fmt='.1%', auto_open=False, output_type="div")

We display the plot in the notebook

In [6]:
figure = figure.update_layout(legend=dict(yanchor="bottom", y=0.02, xanchor="right", x=0.98))
iplot(figure, link_text='')

Here we calculate and display a Pandas Dataframe with some analyses

In [7]:
df = basket.all_properties(properties=[
        "geo_ret",
        "vol",
        "ret_vol_ratio",
        "sortino_ratio",
        "worst_month",
        "cvar_down",
        "max_drawdown",
        "first_indices",
        "last_indices",
    ]
)
In [8]:
df.columns = df.columns.droplevel(level=1)

formats = [
        "{:.2%}",
        "{:.2%}",
        "{:.2f}",
        "{:.2f}",
        "{:.2%}",
        "{:.2%}",
        "{:.2%}",
        "{:%Y-%m-%d}",
        "{:%Y-%m-%d}",
    ]

for item, f in zip(df.index, formats):
    df.loc[item] = df.loc[item].apply(
        lambda x: x if isinstance(x, str) else f.format(x)
    )
In [9]:
df
Out[9]:
Captor Iris Bond Captor Dahlia Green Bond Captor Scilla Global Equity Portfolio
Geometric return -5.40% -3.02% 4.97% -1.04%
Volatility 5.64% 2.77% 13.02% 5.36%
Return vol ratio -0.96 -1.09 0.38 -0.19
Sortino ratio -1.26 -1.34 0.50 -0.25
Worst month -6.49% -4.83% -12.25% -6.06%
CVaR 95.0% -0.90% -0.51% -2.06% -0.89%
Max drawdown -26.65% -15.52% -30.98% -15.14%
first indices 2019-02-12 2019-02-12 2019-02-12 2019-02-12
last indices 2022-06-27 2022-06-27 2022-06-27 2022-06-27

Thank you for listening